import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TextInput, ScrollView,
  Image,Button,ActivityIndicator
} from 'react-native';
// import console = require('console');
import TabNavigator from 'react-native-tab-navigator';
// import Icon from 'react-native-vector-icons/FontAwesome';

import Home from './components/tabbars/Home.js';
import Me from './components/tabbars/Me.js';
import ShopCar from './components/tabbars/ShopCar.js';
import About from './components/tabbars/About.js';

export default class App extends Component {
  constructor(props){
    super(props)
    this.state = {
      selectedTab:'home'
    }
  }

  render(){
    return (
      <View style={styles.container}>
        <TabNavigator>
          <TabNavigator.Item
            selected={this.state.selectedTab === 'home'}
            title="home"
            onPress={() => this.setState({ selectedTab: 'home' })}>
            <Home></Home>
          </TabNavigator.Item>
          <TabNavigator.Item
            selected={this.state.selectedTab === 'me'}
            title="Me"
            // renderBadge={() => <CustomBadgeView />}
            onPress={() => this.setState({ selectedTab: 'me' })}>
            <Me></Me>
          </TabNavigator.Item> 
          <TabNavigator.Item
            selected={this.state.selectedTab === 'shopcar'}
            title="shopcar"
            // renderBadge={() => <CustomBadgeView />}
            badgeText="0"
            onPress={() => this.setState({ selectedTab: 'shopcar' })}>
            <ShopCar></ShopCar>
          </TabNavigator.Item> 
          <TabNavigator.Item
            selected={this.state.selectedTab === 'about'}
            title="about"
            // renderBadge={() => <CustomBadgeView />}
            onPress={() => this.setState({ selectedTab: 'about' })}>
            <About></About>
          </TabNavigator.Item> 
        </TabNavigator>       

      </View>
    );
  }
}




const styles = StyleSheet.create({
  container:{
    flex:1,
    height:'100%'
  }
})